library(tidyverse)

rOceanData is a package currently in development with the aim of making satellite data easily accessible to researchers and stakeholders (managers, conservation groups, researchers). rOceanData accesses a wide range of ocean variables (e.g. sea surface temperature, chlorophyll, salinity) via built-in lists or via the ERDAPP /griddap servers.

The rOceanData workflow follows three steps: 1) extract data, 2) summarise data (e.g. yearly means), and 3) visualise data (static maps, interactive maps, animations):

The package is currently in development, and below are examples of basic functions:

extract_ocean_data

rOceanData is an R package in development with the aim of simplifying access to satellite data on ocean health.

The space argument can either be an area of ocean with determined by corner points (xmin, xmax, ymin, ymax), for example:

maldives_data <- extract_ocean_data("NOAA_DHW", 
                                    space = c(72, 74.5, -1.5, 7.5), 
                                    time = c("1990-01-01", "2020-01-01"))  

Alternatively, if you need data for a particular set of sites with GPS points, upload an excel file with the longitude and latitude and extract_ocean_data will extract only the data for the corresponding points

site_sst_data <- extract_ocean_data(space = "files/sites/sitesurveys.xls", time = c("1990-01-01", "2020-02-01"))  

To check the space prior to downloading the data, use the check_space function:

check_space(space = c(72, 74.5, -1.5, 7.5))

distill_ocean_data

distil /dɪˈstɪl/ - “extract the essential meaning or most important aspects of”

Once the data is extracted, distil_ocean_data() is the second step of the workflow where data can be averaged through space (e.g. reducing the resolution from 1km * 1km to say… 5 * 5km resolution to meaningfully compare datasets) or through time (e.g. finding the average monthly data from a daily dataset).

For example, to get the mean SST for each gridcell across the entire time-series:

maldives_sst_mean <- maldives_data %>% 
      distill_ocean_data(calculate=mean)

Or to get the mean maximum monthly SST for each gridcell :

maldives_sst_mmm <- maldives_data %>% 
      distill_ocean_data(group="month", calculate=max)

Or to get the mean annual SST for each gridcell:

maldives_sst_annual_mean <- maldives_data %>% 
      distill_ocean_data(group="year", calculate=mean)

map_ocean_data

Map ocean data takes the summarised data from distill_ocean_data and generates static maps:

  maldives_sst_mean %>%
  map_ocean_data() 

Alternatively, plot the annual means for each year in the time-series by specifying by=

  maldives_sst_annual_mean %>%
  map_ocean_data(by="year")

interactive_ocean_data

Interactive ocean data takes the summarised data from distill_ocean_data and generates interactive maps:

  maldives_sst_mean %>%
  interactive_ocean_data()

animate_ocean_data

Animate ocean data takes the summarised data from distill_ocean_data and generates animations (similar to the by="year" in the map above)

  maldives_sst_annual_mean %>%
  animate_ocean_data(by="year") %>%
## Creating frames
## 
## Creating animation
## Animation saved to /Users/rof011/rOceanData/code/anim_year.gif